package com.lyj.model;

import java.util.Set;

/**
* 
* @author 李艺江
* @version 创建时间：2019年5月6日 下午10:14:53
*/

public class Question {
	
	private Integer id;
	private Questionnaire Questionnaire;
	private Integer type;
	private String content;
	private Set<Option> options;
	private Set<Record> records;
	
	private Option optionA;
	private Option optionB;
	private Option optionC;
	private Option optionD;
	
	private int recordsCount;
	
	public Question() {
	}

	public Question(com.lyj.model.Questionnaire questionnaire, Integer type, String content) {
		Questionnaire = questionnaire;
		this.type = type;
		this.content = content;
	}

	public Question(com.lyj.model.Questionnaire questionnaire, Integer type, String content, Set<Option> options,
			Set<Record> records) {
		Questionnaire = questionnaire;
		this.type = type;
		this.content = content;
		this.options = options;
		this.records = records;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Questionnaire getQuestionnaire() {
		return Questionnaire;
	}

	public void setQuestionnaire(Questionnaire questionnaire) {
		Questionnaire = questionnaire;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Set<Option> getOptions() {
		return options;
	}

	public void setOptions(Set<Option> options) {
		this.options = options;
		Option options1 [] = new Option[4];
		int i = 0;
		for(int j = 0;j < 4;j++) {
			options1[j] = new Option();
		}
		for(Option option:options) {
			options1[i++] = option;
		}
		optionA = options1[0];
		optionB = options1[1];
		optionC = options1[2];
		optionD = options1[3];
		System.out.println(optionA.getId());
		System.out.println(optionB.getId());
		System.out.println(optionC.getId());
		System.out.println(optionD.getId());
	}

	public Set<Record> getRecords() {
		return records;
	}

	public void setRecords(Set<Record> records) {
		this.records = records;
		this.recordsCount = records.size();
	}

	public int getRecordsCount() {
		return recordsCount;
	}

	public Option getOptionA() {
		return optionA;
	}

	public Option getOptionB() {
		return optionB;
	}

	public Option getOptionC() {
		return optionC;
	}

	public Option getOptionD() {
		return optionD;
	}

}
